$(function(){
    wow = new WOW(
        {
            animateClass: 'animated',
            offset: 300,
            callback:function(box) {
                console.log("WOW: animating <" + box.tagName.toLowerCase() + ">")
            }
        }
    );
    wow.init();
});
var hash1Viewed=false;
$(window).scroll(function(){

    if(hash1Viewed == false){
        if (inView("#hash1")){
           console.log("get hash1");
           hash1Viewed = true;
           imgsrc="../wtm-add/images/p3/01.gif"+"?v="+Math.random();
           $("#hash1 img").attr("src",imgsrc)
        }
    }

})



function inView(selector){
    var option = 600;
    var winTop = $(window).height();
    var winScrolled = $(window).scrollTop();
    var selectorTop = $(selector).offset().top;

    console.log($(selector).offset().top);
    if (winScrolled>selectorTop-option){
        console.log("okkk")
        return true
    }
    else{return false}
}